<?php

include(dirname(__FILE__).'/../../bootstrap/functional.php');

$browser = new myTestFunctional(new sfBrowser());

$browser->
  signInUser('user_no_project','123123')->
  get('/')->
  with('response')->begin()->
    isStatusCode(302)->
    isRedirected()->followRedirect()->
  end()->
  with('request')->begin()->
    isParameter('module', 'project')->
    isParameter('action', 'noProjects')->
  end()->
  with('response')->begin()->
    matches('/нет доступных проектов/')->
  end()
;

$browser->signOutUser();

//Прикрепляем пользователю один проект, но не выбираем его.
$browser->
  signInUser('developer1','123123')->
  get('/')->
  with('response')->begin()->
    isStatusCode(302)->
    isRedirected()->followRedirect()->
  end()->
  with('request')->begin()->
    isParameter('module', 'project')->
    isParameter('action', 'chooseProject')->
  end()->
  with('response')->begin()->
    matches('/Выберите проект/')->
  end()
;

